package com.itheima.service.impl;

import com.itheima.mapper.EmpLogMapper;
import com.itheima.pojo.EmpLog;
import com.itheima.service.EmpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 员工日志服务实现类
 */
@Service
public class EmpLogServiceimpl implements EmpLogService {
    @Autowired
    private EmpLogMapper empLogMapper;

    /**
     * 添加员工日志信息
     * @param empLog
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW) //事务注解
    @Override
    public void insertLog(EmpLog empLog) {
        empLogMapper.insert(empLog);
    }
}
